<?php

namespace App\Http\Requests\Admin\Live;

use App\Http\Requests\BaseFormRequest;
use App\Models\Live\Member;
use Illuminate\Validation\Rule;

class AnchorGiftSaveFormRequest extends BaseFormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'member_id' => ['required', Rule::exists(Member::class, 'id')],
            'quantity' => ['required', 'integer', 'min:1'],
        ];
    }

    public function messages()
    {
        return [
            'quantity.required' => '请输入礼物数量',
            'quantity.integer' => '礼物数量格式错误',
            'quantity.min' => '礼物数量最少1',
            'member_id.exists' => '用户不存在',
        ];
    }

}
